package main.java.prototype.demo;

/**
 * 原型模式
 */
public class Demo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Realizetype realizetype = new Realizetype();
        realizetype.setName("张三");
        Realizetype clone = realizetype.clone();
//        clone.setName("李四");
        System.out.println(realizetype == clone);
//        System.out.println(realizetype.getName());
        System.out.println(clone.getName());
    }
}
